require(["common","coAjax"],function (jSouper,coAjax) {
	App.set("$Event.bus.changepwd.change",function (e,vm) {
		var current_pwd = App.get("$Cache.bus.changepwd.current_pwd");
		var new_pwd = App.get("$Cache.bus.changepwd.new_pwd");
		var new_pwd_bak = App.get("$Cache.bus.changepwd.new_pwd_bak");
		if (!current_pwd) {
			alert("warn","请输入当前密码");
			return;
		}
		if (new_pwd!==new_pwd_bak) {
			alert("warn","两次密码不匹配");
			return;
		}
		coAjax.put(appConfig.bus.change_password,{
			old_password:current_pwd,
			new_password:new_pwd
		},function (result) {
			App.set("$Cache.bus.changepwd.current_pwd","");
			App.set("$Cache.bus.changepwd.new_pwd","");
			App.set("$Cache.bus.changepwd.new_pwd_bak","");
			alert("success","密码修改成功");
		},function (errorCode,xhr,errorMsg) {
			alert("error",errorMsg);
		});
	})
})